]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Reposition corners on changes to the monitor layout
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Feb 2011 14:16:18 +0000 (15:16 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 23 Feb 2011 19:32:31 +0000 (20:32 +0100)
When the monitor layout changes, the panel might have been moved
to another monitor, in which case the rounded corners need to be
repositioned.

https://bugzilla.gnome.org/show_bug.cgi?id=643064

js/ui/panel.js

index 6fa03473a6186c8535d28363911bfe5a1fa31fef..a38bf9aa1d67f7d7cb8bf92100273ef5dd387f98 100644 (file)
@@ -560,7 +560,7 @@ PanelCorner.prototype = {
         this._side = side;
         this.actor = new St.DrawingArea({ style_class: 'panel-corner' });
         this.actor.connect('repaint', Lang.bind(this, this._repaint));
-        this.actor.connect('style-changed', Lang.bind(this, this._reposition));
+        this.actor.connect('style-changed', Lang.bind(this, this.relayout));
     },
 
     _repaint: function() {
@@ -623,7 +623,7 @@ PanelCorner.prototype = {
         cr.restore();
     },
 
-    _reposition: function() {
+    relayout: function() {
         let node = this.actor.get_theme_node();
 
         let cornerRadius = node.get_length("-panel-corner-radius");
@@ -1063,6 +1063,9 @@ Panel.prototype = {
 
         this.actor.set_position(primary.x, primary.y);
         this.actor.set_size(primary.width, PANEL_HEIGHT);
+
+        this._leftCorner.relayout();
+        this._rightCorner.relayout();
     },
 
     _onTrayIconAdded: function(o, icon, role) {